home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / Bitmap / Sources / RbbrBand.h < prev    next >
Encoding:
Text File  |  1996-08-16  |  2.3 KB  |  84 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                RbbrBand.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef RBBRBAND_H
  13. #define RBBRBAND_H
  14.  
  15. // ----- Framework Includes -----
  16.  
  17. #ifndef FWTRACKR_H
  18. #include "FWTrackr.h"
  19. #endif
  20.  
  21. // ----- Graphic Includes -----
  22.  
  23. #ifndef FWRECSHP_H
  24. #include "FWRecShp.h"
  25. #endif
  26.  
  27. //========================================================================================
  28. //    Forward Class Declarations
  29. //========================================================================================
  30.  
  31. class CBitmapFrame;
  32.  
  33. //========================================================================================
  34. //    class CRectRubberBand
  35. //========================================================================================
  36.  
  37. class CRectRubberBand : public FW_CTracker
  38. {
  39. //-----------------------------------------------------------------------------------------
  40. //    Constructors/Destructor
  41. //
  42. public:
  43.     CRectRubberBand(Environment* ev, 
  44.                     CBitmapFrame* frame, 
  45.                     ODFacet* facet, 
  46.                     const FW_CRect& maxRect, 
  47.                     const FW_CPoint& zoomRatio);
  48.     virtual ~CRectRubberBand();
  49.     
  50. //-----------------------------------------------------------------------------------------
  51. //    Inherited API
  52. //
  53. public:
  54.     virtual FW_CPoint     BeginTracking(Environment* ev, 
  55.                                 const FW_CPoint& anchorPoint);
  56.     virtual FW_CPoint     ContinueTracking(Environment* ev, 
  57.                                 const FW_CPoint& anchorPoint, 
  58.                                 const FW_CPoint& previousPoint, 
  59.                                 const FW_CPoint& currentPoint);
  60.     virtual FW_Boolean    EndTracking(Environment* ev, 
  61.                                 const FW_CPoint& anchorPoint, 
  62.                                 const FW_CPoint& lastPoint);
  63.  
  64. //-----------------------------------------------------------------------------------------
  65. //    New API
  66. //
  67. public:
  68.     void                GetRect(FW_CRect& rect)
  69.                             {fRectShape.GetRectangle(rect);}
  70.     FW_CPoint            AlignOnPixel(const FW_CPoint& location);
  71.     
  72.     void                DrawRubberBand(Environment* ev);
  73.     
  74. //-----------------------------------------------------------------------------------------
  75. //    Data Members
  76. //
  77. private:
  78.     FW_CRectShape        fRectShape;
  79.     FW_CRect            fMaxRect;
  80.     FW_CPoint            fZoomRatio;
  81.     CBitmapFrame*        fBitmapFrame;
  82. };
  83.  
  84. #endif